package test_Component;

import javax.swing.DefaultListModel;
import javax.swing.JList;
import javax.swing.ListModel;

public class UIJList extends JList{
	private static JList jlist;
	private static DefaultListModel model = new DefaultListModel();

	private UIJList() {
	}

	public static JList getJList() {
		if (jlist == null) {
			jlist = new JList(model);
		}
		return jlist;
	}

	@Override
	public ListModel getModel() {
		return this.model;
	}

	public static void main(String[] args) {
		DefaultListModel model = new DefaultListModel();
		UIJFrame.getJPanel().add(UIJList.getJList());
		UIJList.getJList().setModel(model);
		model.addElement("a");
		model.addElement("b");

	}
}
